package com.draemon.haixiawenti.repository;

import com.yangzcp.userpojo.Say;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * <p></p>
 *
 * @author  yangz
 * @date    2016/11/13
 * @version latest
 */
public interface SayRepository extends JpaRepository<Say, Integer>{
    @Query("from Say where ref_say.id=?1 order by create_time desc")
    public List<Say> findCond(Integer tieid);

    @Query("from Say where ref_users.sign=?1 order by create_time desc")
    public List<Say> findUserSayList(String sign);

    @Query("from Say where ref_users.sign=?1 and id=?2 order by create_time desc")
    public Say getUserSay(String sign, Integer id);
}
